package com.ruoyi.ifmDepartmentTitle.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ifmDepartmentTitle.domain.IfmDepartmentTitle;
import com.ruoyi.ifmDepartmentTitle.mapper.IfmDepartmentTitleMapper;
import com.ruoyi.ifmDepartmentTitle.service.IIfmDepartmentTitleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;



/**
 * 部职别Service业务层处理
 *
 * @author ruoyi
 * @date 2024-10-31
 */
@Service
public class IfmDepartmentTitleServiceImpl implements IIfmDepartmentTitleService
{
    @Autowired
    private IfmDepartmentTitleMapper ifmDepartmentTitleMapper;

    /**
     * 查询部职别
     *
     * @param titleId 部职别主键
     * @return 部职别
     */
    @Override
    public IfmDepartmentTitle selectIfmDepartmentTitleByTitleId(Long titleId)
    {
        return ifmDepartmentTitleMapper.selectIfmDepartmentTitleByTitleId(titleId);
    }

    /**
     * 查询部职别列表
     *
     * @param ifmDepartmentTitle 部职别
     * @return 部职别
     */
    @Override
    public List<IfmDepartmentTitle> selectIfmDepartmentTitleList(IfmDepartmentTitle ifmDepartmentTitle)
    {
        return ifmDepartmentTitleMapper.selectIfmDepartmentTitleList(ifmDepartmentTitle);
    }

    /**
     * 新增部职别
     *
     * @param ifmDepartmentTitle 部职别
     * @return 结果
     */
    @Override
    public int insertIfmDepartmentTitle(IfmDepartmentTitle ifmDepartmentTitle)
    {
        ifmDepartmentTitle.setCreateTime(DateUtils.getNowDate());
        return ifmDepartmentTitleMapper.insertIfmDepartmentTitle(ifmDepartmentTitle);
    }

    /**
     * 修改部职别
     *
     * @param ifmDepartmentTitle 部职别
     * @return 结果
     */
    @Override
    public int updateIfmDepartmentTitle(IfmDepartmentTitle ifmDepartmentTitle)
    {
        ifmDepartmentTitle.setUpdateTime(DateUtils.getNowDate());
        return ifmDepartmentTitleMapper.updateIfmDepartmentTitle(ifmDepartmentTitle);
    }

    /**
     * 批量删除部职别
     *
     * @param titleIds 需要删除的部职别主键
     * @return 结果
     */
    @Override
    public int deleteIfmDepartmentTitleByTitleIds(Long[] titleIds)
    {
        return ifmDepartmentTitleMapper.deleteIfmDepartmentTitleByTitleIds(titleIds);
    }

    /**
     * 删除部职别信息
     *
     * @param titleId 部职别主键
     * @return 结果
     */
    @Override
    public int deleteIfmDepartmentTitleByTitleId(Long titleId)
    {
        return ifmDepartmentTitleMapper.deleteIfmDepartmentTitleByTitleId(titleId);
    }
}
